package com.thread.test09.hw3;

/**
 * @author bin
 * @date 2025 - 03 -11
 **/
public class MyRunnble implements Runnable{

    private int count = 50;
    @Override
    public void run() {
        while (true) {

            if (count > 0) {
                System.out.println(Thread.currentThread().getName()+"剩余票数：" + count--);
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            } else {
                System.out.println("所有票已售罄");
                break;
            }
        }
    }
}
